/*
 * Copyright (C) 2010-2011 Comcast Cable.  All Rights Reserved.
 */
package com.hercules.android.receiver.model.objects;

/**
 * <p>This class represents resources that display styled strings of text in an XRE application. They support a limited
 * set of HTML tags and CSS styles. It is a simple JavaBean (POJO) that provides getters and setters for all private
 * attributes and performs no argument validation in the setters.</p>
 *
 * <p><strong>Thread safety:</strong> This class is mutable and not thread safe.</p>
 *
 * @author saarixx, jmn
 * @version 1.0
 */
public class XREHTMLText extends XREResource {

    /**
     * <p>The pseudo-HTML formatted text to be displayed by the resource.</p>
     *
     * <p>Defaults to an empty string.</p>
     *
     * <p>Can be any value.</p>
     *
     * <p>Has getter and setter.</p>
     */
    private String htmlText = "";

    /**
     * <p>The XREStylesheet object to be used to display the text. If omitted, no stylesheet will be used.</p>
     *
     * <p>Can be any value.</p>
     *
     * <p>Has getter and setter.</p>
     */
    private XREStylesheet stylesheet;

    /**
     * <p>The amount of vertical spacing between lines of text, measured in pixels.</p>
     *
     * <p>Can be any value.</p>
     *
     * <p>Has getter and setter.</p>
     */
    private int leading;

    /**
     * <p>Creates new instance of {@link XREHTMLText} class.</p>
     */
    public XREHTMLText() {
        // empty constructor
    }

    /**
     * <p>Retrieves the pseudo-HTML formatted text to be displayed by the resource.</p>
     *
     * @return the pseudo-HTML formatted text to be displayed by the resource
     */
    public String getHtmlText() {
        return htmlText;
    }

    /**
     * <p>Sets the pseudo-HTML formatted text to be displayed by the resource.</p>
     *
     * @param htmlText the pseudo-HTML formatted text to be displayed by the resource
     */
    public void setHtmlText(String htmlText) {
        this.htmlText = htmlText;
    }

    /**
     * <p>Retrieves the XREStylesheet object to be used to display the text.</p>
     *
     * @return the XREStylesheet object to be used to display the text
     */
    public XREStylesheet getStylesheet() {
        return stylesheet;
    }

    /**
     * <p>Sets the XREStylesheet object to be used to display the text.</p>
     *
     * @param stylesheet the XREStylesheet object to be used to display the text
     */
    public void setStylesheet(XREStylesheet stylesheet) {
        this.stylesheet = stylesheet;
    }

    /**
     * <p>Retrieves the amount of vertical spacing between lines of text, measured in pixels.</p>
     *
     * @return the amount of vertical spacing between lines of text, measured in pixels
     */
    public int getLeading() {
        return leading;
    }

    /**
     * <p>Sets the amount of vertical spacing between lines of text, measured in pixels.</p>
     *
     * @param leading the amount of vertical spacing between lines of text, measured in pixels
     */
    public void setLeading(int leading) {
        this.leading = leading;
    }
}

